<?php
/*
 * @ https://EasyToYou.eu - IonCube v11 Decoder Online
 * @ PHP 7.2 & 7.3
 * @ Decoder version: 1.1.6
 * @ Release: 10/08/2022
 */

// Decoded file for php version 71.
namespace Sm2;

require "sm2/src/sm/RtSm2.php";
function convert_sign_rs_to_pkcs1($rs)
{
    $sign_pkcs1_format = "30{len}{r}{s}";
    $sign_r = substr($rs, 0, 64);
    $sign_s = substr($rs, 64, 64);
    $len_add = 0;
    if("8" <= $sign_r[0]) {
        $sign_r = "022100" . $sign_r;
        $len_add = $len_add + 1;
    } else {
        $sign_r = "0220" . $sign_r;
    }
    if("8" <= $sign_s[0]) {
        $sign_s = "022100" . $sign_s;
        $len_add = $len_add + 1;
    } else {
        $sign_s = "0220" . $sign_s;
    }
    $sign_pkcs1_format = str_replace("{r}", $sign_r, $sign_pkcs1_format);
    $sign_pkcs1_format = str_replace("{s}", $sign_s, $sign_pkcs1_format);
    if($len_add == 1) {
        $sign_pkcs1_format = str_replace("{len}", "45", $sign_pkcs1_format);
    } elseif($len_add == 2) {
        $sign_pkcs1_format = str_replace("{len}", "46", $sign_pkcs1_format);
    } else {
        $sign_pkcs1_format = str_replace("{len}", "44", $sign_pkcs1_format);
    }
    return $sign_pkcs1_format;
}
function test()
{
    $a = new \Rtgm\sm\RtSm2();
    dump(1);
    exit;
}

?>